const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

rl.question('请输入第一个数字：', (num1) => {
  rl.question('请输入第二个数字：', (num2) => {
    rl.question('请选择运算符（+、-、*、/）：', (operator) => {
      let result;
      switch (operator) {
        case '+':
          result = Number(num1) + Number(num2);
          break;
        case '-':
          result = Number(num1) - Number(num2);
          break;
        case '*':
          result = Number(num1) * Number(num2);
          break;
        case '/':
          result = Number(num1) / Number(num2);
          break;
        default:
          console.log('无效的运算符');
          rl.close();
          return;
      }
      console.log(`结果为：${result}`);
      rl.close();
    });
  });
});